package hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class HDFSClient {

    public static void main(String[] args) throws Exception {

        //创建一个配置类对象
        Configuration conf = new Configuration();

//        conf.set("fs.defaultFS","file:///");

        //根据配置对象创建一个文件系统的类
        FileSystem fs = FileSystem.get(conf);
//        FileSystem fs = FileSystem.get(
//                new URI("hdfs://node101:9820/"),
//                conf,
//                "bduser"
//        );

        fs.mkdirs(new Path("/test/test5"));

//        System.out.println(fs);

        //关闭连接
        fs.close();
    }

}
